package com.hsav.kcxb.view;

import android.content.Context;
import android.graphics.drawable.PaintDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.PopupWindow;

import com.hsav.kcxb.R;
import com.hsav.kcxb.adapter.MenuAdpater;

/**
 * Created by zhao on 17-4-30.
 */

public class MenuPopWindow extends PopupWindow {

    private final Context mContext;
    private final View mRootView;
    private final ListView mLeftLv;
    private final ListView mRightLv;

    public MenuPopWindow(Context context){
        this.mContext = context;
        mRootView = LayoutInflater.from(context).inflate(R.layout.menu_pop_layout,null);
        setContentView(mRootView);
        mLeftLv = (ListView)mRootView.findViewById(R.id.listview_left);
        mRightLv=(ListView)mRootView.findViewById(R.id.listview_right);
        mLeftLv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        mRightLv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

        setBackgroundDrawable(new PaintDrawable());
        setFocusable(true);
        setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
        setOnDismissListener(new OnDismissListener() {
            @Override
            public void onDismiss() {
                mLeftLv.setSelection(0);
                mRightLv.setSelection(0);

            }
        });

//        initAdapter();

    }



    private void initAdapter() {
//        mLeftAdapter = new MenuAdpater(mContext,null ,true);
    }

}
